package kpi.java_training.testing.db;

import java.util.ArrayList;

/**
 * User: Alex Palleev
 * Date: 08.11.13
 * Time: 12:50
 */
public class StatisticsManager {
    private ArrayList<String> statisticsArray;
    private CSVParser csvParser;

    public StatisticsManager() {
        this.statisticsArray = new ArrayList<String>();
        this.csvParser = new CSVParser();
    }

    public void readStatistics(){
        statisticsArray = csvParser.getStatistics();
    }

    public void updateStatistics(String userName, int questions, int correctAnswers){
        readStatistics();
        csvParser.setStatistics(userName, questions, correctAnswers);
    }
}
